package com.hdu.hdu.interceptor;


import com.hdu.hdu.context.StudentInfoCheckContext;

public class PhoneNumberCheckInterceptor implements Interceptor<StudentInfoCheckContext>{
    @Override
    public void handle(StudentInfoCheckContext context) {
        String phoneNumber = context.getStudent().getPhoneNumber();
        if (phoneNumber == null || phoneNumber.length() != 11) {
            context.getErrorMsg().put("PhoneNumberCheckInterceptor", "手机号格式错误");
        }
    }
}
